<template>
	<div class="home">
		<div class="left">
			<div class="top">
				<ul>
					<li>全部</li>
					<li>已预定</li>
					<li>用餐中</li>
					<li>已结账</li>
					<li>空闲</li>
				</ul>
				<el-input placeholder="请输入内容" v-model="search">
					<i slot="prefix" class="el-input__icon el-icon-search"></i>
				</el-input>
			</div>

			<div class="middle" v-for="n in 3" :key="n">
				<div>
					<el-col :span="4">
						<div class="status">用餐中</div>
						<el-card shadow="hover">
							<div class="num">
								3人
								<div>￥125</div>
							</div>

							<div class="taberNum">
								1号桌·四人桌
							</div>
						</el-card>
					</el-col>
				</div>

				<div>
					<el-col :span="4">
						<div class="status" style="background: #01C557;">预定中</div>
						<el-card shadow="hover">
							<div class="num">
								3人
								<div>￥125</div>
							</div>

							<div class="taberNum">
								1号桌·四人桌
							</div>
						</el-card>
					</el-col>
				</div>

				<div>
					<el-col :span="4">
						<div class="status" style="background: #FF6F75;">已结账</div>
						<el-card shadow="hover">
							<div class="num">
								3人
								<div>￥125</div>
							</div>

							<div class="taberNum">
								1号桌·四人桌
							</div>
						</el-card>
					</el-col>
				</div>

				<div>
					<el-col :span="4">
						<div class="status" style="background:#ccc">空闲</div>
						<el-card shadow="hover">
							<div class="num">
								0人
							</div>

							<div class="taberNum">
								1号桌·四人桌
							</div>
						</el-card>
					</el-col>
				</div>
			</div>

			<div class="notice"></div>
		</div>
		<div class="right">
			<div class="nav">
				<div style="flex:4">
					<div>4号桌</div>
					<div>2人</div>
				</div>
				<div style="flex:6">
					<div>会员</div>
					<div>1234567890</div>
				</div>
				<div style="flex:1">
					17:22
				</div>
			</div>
			<div class="content">
				<div style="display:flex;font-weight:bold">
					<div style="flex:6">
						品名
					</div>
					<div style="flex:2">
						数量
					</div>
					<div style="flex:2">
						价格
					</div>
				</div>

				<div style="display:flex" v-for="n in 5" :key="n">
					<div style="flex:6">
						商品名称商品名称
					</div>
					<div style="flex:2">
						x1
					</div>
					<div style="flex:2">
						￥26.15
					</div>
				</div>

				<div class="preferential">
					<span style="margin-right:10px">合计：￥48.55</span>
					<span>优惠：￥48.55</span>
				</div>

				<div class="totalPrice">
					<span>需付：￥188.88</span>
				</div>
			</div>
			<div>
				<div class="btm">
					<el-button type="primary">充值</el-button>
					<el-button type="primary">转桌</el-button>
					<el-button type="primary">退菜</el-button>
					<el-button type="primary">加菜</el-button>
					<el-button type="primary">退台</el-button>
					<el-button type="primary">打印小票</el-button>
				</div>
				<button class="settlement" @click="openform">结账</button>
			</div>

			<el-dialog title="结账" :visible.sync="dialogVisible" width="50%">
				<div class="settlementForm">
					<div class="discount">
						<div>这是一段信息</div>
						<div>这是一段信息</div>
					</div>

					<div class="discount">
						<div class="name">折扣</div>
						<div class="info">9.9折</div>
						<div class="info">9.5折</div>
						<div class="info">9.0折</div>
					</div>

					<div></div>

					<div class="discount">
						<div class="name">满减</div>
						<div class="info">满100减20</div>
						<div class="info">满75减10</div>
					</div>
				</div>

				<span slot="footer" class="dialog-footer">
					<el-button @click="dialogVisible = false">取 消</el-button>
					<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
				</span>
			</el-dialog>
		</div>
	</div>
</template>

<script>
export default {
	data() {
		return {
			search: '',
			dialogVisible: false,
		};
	},

	methods: {
		openform() {
			this.dialogVisible = true;
		},
	},
};
</script>

<style lang="scss" scoped>
.home {
	display: flex;
}
.left {
	width: 75%;
	margin-left: 20px;
}
.right {
	margin-left: 40px;
	width: 25%;
	background: #fff;
	.el-dialog__header {
		background: #409eff;
		.el-dialog__title {
			color: #fff;
		}
	}
}

.top {
	display: flex;
	margin-bottom: 20px;
	ul {
		display: flex;
		height: 40px;
		line-height: 40px;
		width: 800px;
		list-style: none;
		li {
			flex: 1;
		}
	}
}

.el-card {
	margin-right: 20px;
}

.status {
	text-align: center;
	margin-right: 20px;
	background: #409eff;
	height: 30px;
	line-height: 30px;
	border-top-left-radius: 5px;
	border-top-right-radius: 5px;
}

.el-col-4 {
	margin-top: 10px;
}

.num {
	height: 60px;
	text-align: center;
	font-size: 28px;
	color: rgb(66, 148, 255);
	div {
		font-size: 16px;
		color: red;
	}
}

.taberNum {
	color: rgba(0, 0, 0, 0.562);
	text-align: center;
	font-size: 10px;
}

.nav {
	display: flex;
	background: #409eff;
	color: #fff;
	height: 50px;
	line-height: 25px;
	div {
		margin-left: 5px;
	}
}

.content {
	> div {
		height: 30px;
		line-height: 30px;
	}
}

.preferential {
	text-align: right;
	font-weight: bold;
}

.totalPrice {
	text-align: right;
	background: #e2e2e2;
}

.btm {
	display: flex;
	// justify-content: space-around;
	flex-wrap: wrap;
	.el-button {
		padding: 0;
		height: 40px;
		line-height: 40px;
		width: 30%;
		margin: 5px;
	}
}

.settlement {
	display: block;
	height: 40px;
	line-height: 40px;
	width: 100%;
	margin: 0 auto;
	margin-top: 10px;
	background: rgb(255, 74, 54);
	border: none;
	border-radius: 5px;
}

.settlementForm{
	>div{
		height: 32px;
	}
}

.discount {
	display: flex;
	.name {
		height: 32px;
		line-height: 32px;
	}
	.info {
		padding: 5px 10px;
		border: 1px solid #ccc;
		border-radius: 10px;
		margin: 0 20px;
	}
}
</style>
